﻿using System;

class Program
{
    static void Main()
    {
        int[] nums = { 12, 5, 7, 20, 3 };
        int max = nums[0], min = nums[0], sum = 0;

        foreach (int num in nums)
        {
            if (num > max) max = num;
            if (num < min) min = num;
            sum += num;
        }

        double average = (double)sum / nums.Length;
        Console.WriteLine($"最大值：{max}, 最小值：{min}, 和：{sum}, 平均值：{average:F2}");
    }
}
